package hjw.com.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * <p>Project:Academic - Book
 *
 * @author IvanWei玮 -- maste
 * @version 1.0
 * @DataTime 2025/1/20 16:56
 * @since 1.8
 */
public class Book {
    private int id;
    private String name;
    private String sn;
    private double price;
    private double price2;
    private String maker;
    /**
     * @ JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") 配置日期格式的方法
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date tmake;
    private Type type;
    private String pic;
    private String author;
    private int salenum;
    private int stock;
    private String info;
    private String info2;

    public Book() {
        this.id = 0;
        this.name = "";
        this.sn = "";
        this.price = 0.0;
        this.price2 = 0.0;
        this.maker = "";
        this.tmake = new Date();
        this.type = new Type();
        this.pic = "";
        this.author = "";
        this.salenum = 0;
        this.stock = 0;
        this.info = "";
        this.info2 = "";
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getPrice2() {
        return price2;
    }

    public void setPrice2(double price2) {
        this.price2 = price2;
    }

    public String getMaker() {
        return maker;
    }

    public void setMaker(String maker) {
        this.maker = maker;
    }

    public Date getTmake() {
        return tmake;
    }

    public void setTmake(Date tmake) {
        this.tmake = tmake;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getSalenum() {
        return salenum;
    }

    public void setSalenum(int salenum) {
        this.salenum = salenum;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getInfo2() {
        return info2;
    }

    public void setInfo2(String info2) {
        this.info2 = info2;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sn='" + sn + '\'' +
                ", price=" + price +
                ", price2=" + price2 +
                ", maker='" + maker + '\'' +
                ", tmake=" + tmake +
                ", type=" + type +
                ", pic='" + pic + '\'' +
                ", author='" + author + '\'' +
                ", salenum=" + salenum +
                ", stock=" + stock +
                ", info='" + info + '\'' +
                ", info2='" + info2 + '\'' +
                '}';
    }
}
